package x.mybatis.metadata;

/**
 * 字段元数据
 *
 * @author hanjuntao
 * @date 2025/5/8 0008
 */
public class ColumnMetadata {
  /**
   * Java 字段名
   */
  private String fieldName;

  /**
   * 数据库列名
   */
  private String columnName;
  /**
   * Java 类型
   */
  private Class<?> javaType;
  /**
   * 是否为主键
   */
  private boolean isPrimaryKey;

  public String getFieldName() {
    return fieldName;
  }

  public void setFieldName(String fieldName) {
    this.fieldName = fieldName;
  }

  public String getColumnName() {
    return columnName;
  }

  public void setColumnName(String columnName) {
    this.columnName = columnName;
  }

  public Class<?> getJavaType() {
    return javaType;
  }

  public void setJavaType(Class<?> javaType) {
    this.javaType = javaType;
  }

  public boolean isPrimaryKey() {
    return isPrimaryKey;
  }

  public void setPrimaryKey(boolean primaryKey) {
    isPrimaryKey = primaryKey;
  }

  @Override
  public String toString() {
    return "ColumnMetadata{" +
            "fieldName='" + fieldName + '\'' +
            ", columnName='" + columnName + '\'' +
            ", javaType=" + javaType +
            ", isPrimaryKey=" + isPrimaryKey +
            '}';
  }
}
